#include "shadewidget.h"
#include "ui_shadewidget.h"
#include <QPainter>

ShadeWidget::ShadeWidget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::ShadeWidget)
{
    ui->setupUi(this);
    this->setAttribute(Qt::WA_TranslucentBackground, true);
    this->setWindowFlags(Qt::FramelessWindowHint|Qt::WindowStaysOnTopHint);
}

ShadeWidget::~ShadeWidget()
{
    delete ui;
}

void ShadeWidget::paintEvent(QPaintEvent *e)
{
    Q_UNUSED(e);
    QStyleOption opt;
    opt.initFrom(this);
    QPainter p(this);
    style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);//绘制样式
}
